import React, { Component } from 'react';
import { observer } from 'mobx-react';
import { action } from 'mobx';
import { Space, Button } from 'antd';

import request from '@/utils/request';
import notification from '@/utils/notification';

@observer
class Test extends Component {

  @action.bound
  handleTestRequest() {
    request('/x1/private/v1').then((res: any) => {
      console.log(res);
    });
  }

  @action.bound
  handleTestNotification() {
    notification.success();
    notification.info();
    notification.warning();
    notification.error();
  }

  render() {
    return (
      <div style={{ margin: 8 }}>
        <Space>
          <Button type='primary' onClick={this.handleTestRequest}>测试request请求</Button>
          <Button type='primary' onClick={this.handleTestNotification}>测试Notification</Button>
        </Space>
      </div>
    );
  }
}
 
export default Test;